package com.axonactive.training.dao;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.axonactive.training.model.Income;

@Stateless
public class IncomeDao {
	@PersistenceContext
	private EntityManager em;
	
	public void saveIncome(Income income){
		em.persist(income);
	}
	
	public List<Income> getIncomeList(){
		return em.createQuery("select i from Income i", Income.class).getResultList();		
	}
}
